package com.cdd.permission.controller.api;

import com.cdd.permission.service.PermissionService;
import com.cdd.permission.service.impl.PermissionServiceImpl;
import com.common.entity.Permission;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TODO
 *
 * @author lenovo
 * @version 1.0
 * @since 2022-08-31  20:43:08
 */
@RestController
@RequestMapping("api/permission/permission")
public class ApiPermissionController {
    @Autowired
    private PermissionService permissionService;
    //根据userid查询当前用户的权限
    @RequestMapping("/selectPermissionByUserid")
    public List<String> selectPermission(@RequestParam String userId){
        return permissionService.selectselectPermission(userId);
    }
    //查询所有的权限
    @PostMapping("/selectAllPermission")
    public List<Permission> selectAllPermission(){
        return permissionService.selectAllPermission();
    }
}
